package com.applcn.shop.constant;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * com.applcn.shop.constant
 * Description:
 *
 * @author: 大妖怪
 * @date: 2020-04-01 23:48
 */
public enum AuthTypeEnum implements IEnum<Integer> {

    /**
     * 企业
     */
    ENTERPRISE(1, "企业"),

    /**
     * 个人
     */
    PERSONAL(2, "个人");

    private int code;

    private String desc;

    public static AuthTypeEnum getAuthType(int code) {
        for (AuthTypeEnum authTypeEnum : AuthTypeEnum.values()) {
            if (authTypeEnum.getCode() == code) {
                return authTypeEnum;
            }
        }

        return null;
    }

    AuthTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return this.getCode();
    }
}
